package com.yonyou.pmclouds.workflow.util;

public enum ApprovalStatusEnum {

    APPROVAL_STATUS_ADOPT("adopt","通过"),
    APPROVAL_STATUS_REJECT("Reject","驳回"),
    APPROVAL_STATUS_APPROVAL_PENDING("approvalPending","待审"),
    APPROVAL_STATUS_SUBMIT("submit","提交"),
    APPROVAL_STATUS_DELETED("deleted","被抢占");

    private String code;
    private String name;

    ApprovalStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(String code) {
        for(ApprovalStatusEnum businessObjectEnum : ApprovalStatusEnum.values()) {
            if(businessObjectEnum.getCode().equalsIgnoreCase(code)) {
                return businessObjectEnum.getName();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
